40923123 cp2020

  • Home
    • Site Map
    • reveal
    • blog
  • 首頁
  • 第一組組員
  • git指令表
  • HW1
    • unit 1 succeeding PC Hardware
      • What You Need to Know About the Course
      • About These Materials
    • unit2 hardware basice
      • PCH1 The Basics
      • PCH2 Procedures and Safety
      • PCH3 Customer Relations
  • python variable
    • keywords
      • input
      • print
    • 變數及基本運算
      • assign 指定
    • Dictionary 字典
  • 問題排除
    • 1 heading問題
    • 2 提醒
    • 3 user內容的方式
    • 4 github page not updating
    • 5 網站編輯器無法開啟
    • 6 usb的問題總結
    • 7 同學大部分的問題和集 舊版
  • 教學歷程
    • W1至W8
    • W8 test
    • W9
  • HW2
    • HW2之1
    • HW2之2
    • HW2之3
  • 同學的問題集中串
  • 打開動態網站的方法
  • pyrhon學習網站
    • 英文
    • 中文
assign 指定 << Previous Next >> 問題排除

Dictionary 字典

主要是把一群可能是數字,字串,或者其他的東西做出分類並儲存

例如:

game_1 = {'name' : 'lol' , 'year' : '2010' }
game_2 = dict (name = 'PUBG' , year = '2017') 

建立字典以後,我們可以利用下面的作法來存取 key 的值,也就是透過 key 來取得對應的 value:

print (game_1['name'])
print (game_2['year'])

執行完如下圖:

簡單來說就是輸入對應的key就會丟給你字典裡相對的資料


assign 指定 << Previous Next >> 問題排除

Copyright © All rights reserved | This template is made with by Colorlib